/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package models;

import java.util.Set;
import play.db.jpa.*;
import javax.persistence.*;

/**
 *
 * @author Zlobniy
 */
@Entity
@Table(name="user")
public class User extends Model {
    
    @ManyToMany(cascade=CascadeType.PERSIST)
    private Set<Company> companyList;
    
    private String firstName;
    private String secondName;
    private String lastName;
    private String email;
    private String phone;
    private Integer status;
    
    @ManyToOne(cascade= CascadeType.PERSIST)
    private City city;
    
    @ManyToOne(cascade= CascadeType.PERSIST)
    private Country country;
    
    @ManyToMany(cascade=CascadeType.PERSIST)
    private Set<User> friends;
    
    public User(City city, Country country, String firstName, String secondName, String lastName, String email, String phone, Integer status){
        this.city = city;
        this.country = country;
        this.firstName = firstName;
        this.secondName = secondName;
        this.lastName = lastName;
        this.email = email;
        this.phone = phone;
        this.status = status;
    }

    public City getCity() {
        return city;
    }

    public void setCity(City city) {
        this.city = city;
    }

    public Set<Company> getCompanyList() {
        return companyList;
    }

    public void setCompanyList(Set<Company> companyList) {
        this.companyList = companyList;
    }

    public Country getCountry() {
        return country;
    }

    public void setCountry(Country country) {
        this.country = country;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public Set<User> getFriends() {
        return friends;
    }

    public void setFriends(Set<User> friends) {
        this.friends = friends;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getSecondName() {
        return secondName;
    }

    public void setSecondName(String secondName) {
        this.secondName = secondName;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
    
    
    
}
